import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
import { BaseEntity } from './base.entity';
import { DynamicReply } from './dynamic-reply.entity';
import { User } from './user.entity';

/**
 * 用户评论表
 */
@Entity('dynamic_comment')
export class DynamicComment extends BaseEntity {
  @PrimaryGeneratedColumn({
    type: 'int',
    name: 'id',
    comment: '主键，自增',
  })
  id: number;

  @Column({
    type: 'int',
    name: 'comment_user_id',
    comment: `评论人id`,
  })
  commentUserId: number;

  userInfo: User;

  @Column({
    type: 'int',
    name: 'comment_dynamic_id',
    comment: '被评论动态的id',
  })
  commentDynamicId: number;

  @Column({
    type: 'varchar',
    name: 'comment_content',
    comment: '评论内容',
  })
  commentContent: string;

  reply: DynamicReply[];
}
